package com.zzy.demo.web;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * 
 * @author guokaige
 *
 */
@Controller
public class IndexController {


	@RequestMapping({"/","/index"})
	public String index(ModelMap map,Authentication authentication) {
		User user = (User) authentication.getPrincipal();
		map.put("username", user.getUsername());
		return "index";
	}
	
	
}
